<template>
  <div>
    <ul class="tab_list">
      <li v-for="(item, index) in list" :key="index" @click="to('/card/', item.enterprise_id)">
        <div class="cen">
            <img v-if="item.logo" :src="item.logo" alt />
            <img v-if="!item.logo" src="@/assets/img/nodata.png" alt />
            <div class="tit">
              <p class="text-cut-one">{{item.enterprise_title}}</p>
              <dl>
                <dd>链配网VIP会员</dd>
                <dd>品类：{{item.type_name}}</dd>
              </dl>
              <dl>
                <dd v-show="item.created_time">申请时间：{{item.created_time}}</dd>
              </dl>
            </div>
          </div>
      </li>
      <load @loadData="getData" :list="list" :total="total"  :nodata="list.length<10?true:false"></load>
    </ul>
  </div>
</template>

<script>
import load from "../components/load";
export default {
  components: {
    load
  },
  data() {
    return {
      list: [],
      total: 0
    };
  },
  mounted() {
    this.getData(1);
  },
  methods: {
    getData(page) {
      this.$axios.post( "/wap/personal/browsing", {
        token: window.localStorage.getItem("token"),
        page: page,
        limit: 10
      }).then(res => {
        if (page == 1) {
          this.list = [];
          this.topList = [];
        }
        if (res.data.data.length == 0) {
          this.total++;
          return false;
        }
        for (let i in res.data.data) {
          this.list.push(res.data.data[i]);
        }
      });
    },
    to(path, id){
      this.$router.push({
        path: path,
        query: {
          id: id
        }
      })
    }
  }
};
</script>

<style scoped>
.bgfff {
  background-color: #fff;
  padding: 0.3rem 0.2rem;
}
.tab_list {
  background-color: #fff;
  padding: 0.1rem 0.2rem 0.3rem 0.2rem;
}
.tab_list li {
  border-bottom: 1px solid #ededed;
  padding: 0.2rem 0;
}
.tab_list li:last-child {
  border-bottom: none;
}
.tab_list .cen {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tab_list .cen img {
  display: block;
  width: 2.28rem;
  height: 1.73rem;
}
.tab_list .tit {
  margin-left: 0.2rem;
  flex: 1;
}
.tab_list .tit p {
  font-size: 0.32rem;
  color: #333333;
  margin-bottom: 0.6em;
  line-height: 1.5em;
}
.tab_list .tit dl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #656565;
  font-size: 0.26rem;
  line-height: 1.5em;
}
.tab_list .tit dd.gray {
  background-color: #ececec;
  padding: 2px 3px;
  border-radius: 4px;
}
</style>
